25 research outputs found

    Streamlining Policy Creation in Policy Frameworks

    Get PDF
    {\it Policy frameworks} provide a technique for improving reuse in program analysis: the same language frontend, and a core analysis semantics, can be shared among multiple analysis policies for the same language, while analysis domains (such as units of measurement) can be shared among frameworks for different languages. One limitation of policy frameworks is that, in practice, adding a new policy can still require a significant level of knowledge about the internals of the semantics definition. This abstract describes work on extending policy frameworks to solve this limitation, making policies reflective over their requirements and generating the policy semantics from a higher-level policy description language

    A Rewriting Logic Semantics Approach to Modular Program Analysis

    Get PDF
    The K framework, based on rewriting logic semantics, provides a powerful logic for defining the semantics of programming languages. While most work in this area has focused on defining an evaluation semantics for a language, it is also possible to define an abstract semantics that can be used for program analysis. Using the SILF language (Hills, Serbanuta and Rosu, 2007), this paper describes one technique for defining such a semantics: policy frameworks. In policy frameworks, an analysis-generic, modular framework is first defined for a language. Individual analyses, called policies, are then defined as extensions of this framework, with each policy defining analysis-specific semantic rules and an annotation language which, in combination with support in the language front-end, allows users to annotate program types and functions with information used during program analysis. Standard term rewriting techniques are used to analyze programs by evaluating them in the policy semantics

    Static, Lightweight Includes Resolution for PHP

    Get PDF
    Dynamic languages include a number of features that are challenging to model properly in static analysis tools. In PHP, one of these features is the include expression, where an arbitrary expression provides the path of the file to include at runtime. In this paper we present two complementary analyses for statically resolving PHP includes, one that works at the level of individual PHP files and one targeting PHP programs, possibly consisting of multiple scripts. To evaluate the effectiveness of these analyses we have applied the first to a corpus of 20 open-source systems, totaling more than 4.5 million lines of PHP, and the second to a number of programs from a subset of these systems. Our results show that, in many cases, includes can be either resolved to a specific file or a small subset of possible files, enabling better IDE features and more advanced program analysis tools for PHP

    Program Analysis Scenarios in Rascal

    Get PDF
    Rascal is a meta programming language focused on the implementation of domain-specific languages and on the rapid construction of tools for software analysis and software transformation. In this paper we focus on the use of Rascal for software analysis. We illustrate a range of scenarios for building new software analysis tools through a number of examples, including one showing integration with an existing Maude-based analysis. We then focus on ongoing work on alias analysis and type inference for PHP, showing how Rascal is being used, and sketching a hypothetical solution in Maude. We conclude with a high-level discussion on the commonalities and differences between Rascal and Maude when applied to program analysis

    Meta-Language Support for Type-Safe Access to External Resources

    Get PDF
    Meta-programming applications often require access to heterogeneous sources of information, often from different technological spaces (grammars, models, ontologies, databases), that have specialized ways of defining their respective data schemas. Without direct language support, obtaining typed access to this external, potentially changing, information is a tedious and error-prone engineering task. The Rascal meta-programming language aims to support the import and manipulation of all of these kinds of data in a type-safe manner. The goal is to lower the engineering effort to build new meta programs that combine information about software in unforeseen ways. In this paper we describe built-in language support, so called \textit{resources}, for incorporating external sources of data and their corresponding data-types while maintaining type safety. We demonstrate the applicability of Rascal resources by example, sho

    The Rascal meta-programming language - a lab for software analysis, transformation, generation & visualization

    Get PDF
    National audienceThis paper summarizes the goals and features of a do- main specific programming language called Rascal. On the one hand it is designed to facilitate software research -- research about software in general. On the other hand Rascal is applied to specific software portfolios as well, as a means to improve them and as a means to learn to understand them. Specifically, Rascal is used create tools that analyze, transform, generate or visualize source code of software products. Such tools are motivated by the need to im- prove quality of existing software or the need to lower its cost-of-ownership. More generally such tools are cre- ated to build laboratory experiments that observe and measure quality, or try and improve software quality, etc. In this paper we provide an overview of Rascal as a "domain specific language for meta programming". We first explain its goals and then its features. We end by highlighting some example applications in the area of software analysis and transformation
    corecore